import request from '@/utils/request'

// 订单列表
export const getOrders = function(params) {
  return request({
    url: '/api/order-service/order/search',
    method: 'GET',
    params
  })
}

// 订单列表
// export const timeOrders = function(params) {
//   return request({
//     url: '/api/order-service/order/search',
//     method: 'GET',
//     params
//   })
// }

// 日期格式化
export const dateFormatting = function(data) {
  const arr = []
  data.join(',').split(',').forEach((item) => {
    const data = item.substring(4, 7)
    const day = item.substring(8, 10)
    const years = item.substring(11, 15)
    const month = this.timeData.findIndex((item) => item === data) + 1
    const time = years + '-' + month + '-' + day
    arr.push(time)
  })
  return arr
}
